function img_ = sample_down( img, varargin )
%
%
%author: Sebastian Schmelcher version: 2012-01-30
factor=2;
if(nargin>1)
    factor=varargin{1};
end

[n,m]=size(img);
n_=floor(n/factor);
m_=floor(m/factor);

img_=zeros(n_,m_);
for i=1:n_
    for j=1:m_
        img_(i,j)=img(i*factor,j*factor);
    end
end


end

